package com.hhj.service.impl;

import com.hhj.dao.ProviderDao;
import com.hhj.pojo.Provider;
import com.hhj.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProviderServiceImpl implements ProviderService {

    @Autowired
    @Qualifier("providerDao")
    private ProviderDao providerDao;

    @Override
    public boolean add(Provider provider) {
        int add = providerDao.add(provider);
        if (add>0){
            return true;
        }
        return false;
    }

    @Override
    public List<Provider> getProviderList(String proName, String proCode) {
        return providerDao.getProviderList(proName,proCode);
    }

    @Override
    public int deleteProviderById(String delId) {
        return providerDao.deleteProviderById(delId);
    }

    @Override
    public Provider getProviderById(String id) {
        return providerDao.getProviderById(id);
    }

    @Override
    public boolean modify(Provider provider) {
        int modify = providerDao.modify(provider);
        if (modify>0){
            return true;
        }
        return false;
    }
}
